package com.proxy.dynamic;

/**
 * @author zhupanlin
 * @version 1.0
 * @description: TODO
 * @date 2024/4/16 14:35
 */
public class Client {

    public static void main(String[] args) {
        // 创建目标对象
        ITeacherDao target = new TeacherDao();
        
        // 给目标对象，创建代理对象
        ITeacherDao proxyInstance = (ITeacherDao) (new ProxyFactory(target).getProxyInstance());
        // proxyInstance = com.proxy.dynamic.TeacherDao@4b67cf4d 在内存中动态生成了代理对象
        System.out.println("proxyInstance = " + proxyInstance);
        
        proxyInstance.teach();
        proxyInstance.sayHello("啊哈");
    }
    
}
